<%--
  Created by IntelliJ IDEA.
  User: 雷神
  Date: 2021/3/24
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="view/bootstrap-3.3.5/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="view/bootstrapvalidator/css/bootstrapValidator.css" />
    <script charset="utf-8" src="view/jquery/jquery-1.10.2.min.js"></script>
    <script charset="utf-8" src="view/bootstrap-3.3.5/js/bootstrap.js"></script>
    <script charset="utf-8" src="view/bootstrapvalidator/js/bootstrapValidator.js"></script>
</head>
<body>
<div class="container col-sm-12">
    <div class="panel panel-info">
        <!-- 标题开始-->
        <div class="panel-heading">
            资产类别
            <button class="btn btn-primary btn-xs pull-right" data-toggle="modal" data-target="#myModal">新建</button>
        </div>
        <table class="table  table-hover ">
            <thead>
            <tr>
                <th>类别别名</th>
                <th>类别名称</th>
                <th>类别状态</th>
                <th>是否禁用</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${list}" var="lst">
            <tr>
                <td>${lst.code}</td>
                <td>${lst.typeName}</td>
                <td>
                    <c:if test="${lst.status=='0'}">禁用</c:if>
                    <c:if test="${lst.status=='1'}">启用</c:if>
              </td>
                <td>

                    <c:if test="${lst.status=='0'}">
                        <a href="zctype/update?oid=${lst.oid }&status=${lst.status}" class="btn btn-primary btn-xs">启用</a>
                    </c:if>
                    <c:if test="${lst.status=='1'}">
                        <a href="zctype/update?oid=${lst.oid }&status=${lst.status}" class="btn btn-warning btn-xs">禁用</a>
                    </c:if>

                </td>
                <td>
                    <a href="zctype/delete?oid=${lst.oid}" class="btn btn-xs btn-danger">删除</a>
                </td>
            </tr>
            </c:forEach>
            <tbody>
        </table>
    </div>

</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close"
                        data-dismiss="modal" aria-hidden="true">

                </button>
                <h4 class="modal-title" id="myModalLabel">
                    新建资产类别
                </h4>
            </div>
            <div class="modal-body">
                <form action="zctype/add" role="form" class="form-horizontal"
                      id="myform" method="post">
                    <div class="form-group">
                        <label for="code" class="col-md-4 control-label">类别别名:</label>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="code"
                                   name="code" placeholder="请输入类别别名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="typeName" class="col-md-4 control-label">类别名称:</label>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="typeName"
                                   name="typeName" placeholder="请输入类别名称">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="typeName" class="col-md-4 control-label">类别状态:</label>
                        <div class="col-md-5">
                           <input type="radio" name="status"   value="0">禁用
                            <input type="radio" name="status"  value="1">启用
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-offset-5">
                            <input type="submit" class="btn btn-info" value="新建">
                            <input type="reset" class="btn btn-default" id="reset" value="取消">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal">关闭
                </button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
